package ExampleSCM;

public class Director extends Approver{
    private String name;

    public Director(String name) {
        this.name = name;
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        System.out.println("主任["+name+"]审批");
        if(request.getAmount()<=50000){
            System.out.println("该次采购金额小于5万元，主任有权审批");
            System.out.println("主任["+name+"]审批完成");
            System.out.println("采购内容："+request.getPurpose()+"\t采购数量："+request.getNumber()+"\t采购金额："+request.getAmount());
        }else{
            System.out.println("该次采购金额大于5万元，主任无权审批，移交副董事长");
            successor.processRequest(request);
        }
    }
}
